package achao.gallary.com.normalgallary;

import android.content.Context;

import com.bumptech.glide.load.model.stream.BaseGlideUrlLoader;

/**
 * @Describe
 * @Author Jungle68
 * @Date 2017/3/4
 * @Contact master.jungle68@gmail.com
 */
public class CustomImageModelLoader extends BaseGlideUrlLoader<CustomImageSizeModel> {
    private Context mContext;

    public CustomImageModelLoader(Context context) {
        super(context);
        mContext = context.getApplicationContext();
    }

    @Override
    protected String getUrl(CustomImageSizeModel model, int width, int height) {

        String baseUrl = "http://192.168.2.222/api/v1/storages/%s/%d";
        String url = String.format(baseUrl, model.getImageBean().getImageUrl(), 100);
        return url;
    }
}